package top.wjgyy.tools.ddns.enums;

import java.util.Arrays;
import java.util.List;

public enum AliConstants {
    IPV4("A", "将域名指向一个ipv4地址"),
    IPV6("AAAA", "将域名指向一个ipv6地址"),
    // CNAME("CNAME", "将域名指向另一个域名"),
    ;
    private String type;
    private String notes;

    AliConstants(String type, String notes) {
        this.type = type;
        this.notes = notes;
    }

    public String getType() {
        return type;
    }

    public String getNotes() {
        return notes;
    }

    public static List<AliConstants> getAllType(){
        return Arrays.asList(values());
    }

    public static AliConstants getByType(String type){
        for (AliConstants value : values()) {
            if (value.getType().equals(type)) return value;
        }
        return null;
    }
}
